package com.heima.utils.thread;

import com.heima.model.wemedia.pojos.WmUser;

import java.util.HashMap;

/**
 * <p>
 *
 * </p>
 *
 * @author lzt
 * @version 1.0
 * @since 2024/4/9 上午11:10
 */
public class WmTreadLocalUtil {
    private static ThreadLocal<WmUser> WM_USER_THREAD_LOCAL = new ThreadLocal<>();

    // 存入线程
    public static void setUser(WmUser user) {
        WM_USER_THREAD_LOCAL.set(user);
    }

    // 获取线程
    public static WmUser getUser() {
        return WM_USER_THREAD_LOCAL.get();
    }

    // 销毁
    public static void clear() {
        WM_USER_THREAD_LOCAL.remove();
    }
}
